using System;
using System.Collections.Generic;
using System.Text;
using EFFC.Net.Interface;

namespace EFFC.Net.Data.Base
{
    public class ListStd:StandardData<List<IStandardData>>
    {
        public override StdType StdType
        {
            get { return StdType.List; }
        }

        public override string ToStdFormatString()
        {
            return "";
        }

        public override string ToString(string format)
        {
            return "";
        }

        public override string ToString(IFormatProvider format)
        {
            return "";
        }

        public int Count
        {
            get
            {
                return this.Value.Count;
            }
        }

        public IStandardData this[int i]
        {
            get
            {
                if (i < this.Count)
                {
                    return this.Value[i];
                }
                else
                {
                    return null;
                }
            }
            set
            {
                this.Value.Add(value);
            }
        }

        public T GetValue<T>(int i) where T : IStandardData
        {
            return (T)this[i];
        }

        public void AddRange(ListStd l)
        {
            this.Value.AddRange(l.Value.GetRange(0,l.Count));
        }
    }
}
